package cn.com.customer.manager.adapter

import android.view.View
import android.widget.ImageView
import cn.com.customer.manager.R
import cn.com.customer.manager.bean.EmailInfo
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.xuexiang.xui.widget.imageview.RadiusImageView

class EmailAdapter(rid: Int) : BaseQuickAdapter<EmailInfo, BaseViewHolder>(rid) {
    override fun convert(helper: BaseViewHolder?, item: EmailInfo?) {
        helper?.let {
            val ivMsgType = it.getView(R.id.iv_email_type) as RadiusImageView
            ivMsgType.setImageResource(R.drawable.instation_zixun)
            it.setText(R.id.tv_email_title, item?.mailTitle)
            it.setText(R.id.tv_email_name, item?.sendName + ":" + item?.sendMobile)
            it.setText(R.id.tv_email_desc, item?.mailContent)
            it.setText(R.id.tv_time_email, item?.sendDate)

            (it.getView(R.id.iv_is_read) as ImageView).visibility=View.VISIBLE
        }


    }
}